package com.example.oop.Repository;

import com.example.oop.POJO.Chat;
import com.example.oop.POJO.ChatRoom;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface ChatRepository extends JpaRepository<Chat, Integer> {
    List<Chat> findBySendChatRoomAndReceiveChatRoomOrderByChatTime(ChatRoom sendChatRoom, ChatRoom receiveChatRoom);

    List<Chat> deleteBySendChatRoom(ChatRoom sendChatRoom);
}
